//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 
	/// <summary>
	/// </summary>
	public class Menu_BA
	{
		public Menu_BA() {}
#region 'Variables And Properties'
		 private int int_IdMenu ;
		 public int IdMenu
			{
			 get 	
				{
					 return this.int_IdMenu;
				}
			 set 	
				{
					int_IdMenu=value;
				}
			}
		 private int int_IdMenuSub ;
		 public int IdMenuSub
			{
			 get 	
				{
					 return this.int_IdMenuSub;
				}
			 set 	
				{
					int_IdMenuSub=value;
				}
			}
		 private string string_TenMenu ;
		 public string TenMenu
			{
			 get 	
				{
					 return this.string_TenMenu;
				}
			 set 	
				{
					string_TenMenu=value;
				}
			}
		 private int int_SapXep ;
		 public int SapXep
			{
			 get 	
				{
					 return this.int_SapXep;
				}
			 set 	
				{
					int_SapXep=value;
				}
			}
		 private bool bool_HienThi_TinTuc ;
		 public bool HienThi_TinTuc
			{
			 get 	
				{
					 return this.bool_HienThi_TinTuc;
				}
			 set 	
				{
					bool_HienThi_TinTuc=value;
				}
			}
		 private bool bool_HienThi_MenuChinh ;
		 public bool HienThi_MenuChinh
			{
			 get 	
				{
					 return this.bool_HienThi_MenuChinh;
				}
			 set 	
				{
					bool_HienThi_MenuChinh=value;
				}
			}
		 private bool bool_HienThi_MenuBottom ;
		 public bool HienThi_MenuBottom
			{
			 get 	
				{
					 return this.bool_HienThi_MenuBottom;
				}
			 set 	
				{
					bool_HienThi_MenuBottom=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the Menu table.
		/// <summary>
		/// <param name="IdMenu"></param>
		/// <param name="IdMenuSub"></param>
		/// <param name="TenMenu"></param>
		/// <param name="SapXep"></param>
		/// <param name="HienThi_TinTuc"></param>
		/// <param name="HienThi_MenuChinh"></param>
		/// <param name="HienThi_MenuBottom"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			Menu_DA clsDA_Menu = new Menu_DA();
			clsDA_Menu.IdMenu=int_IdMenu;
			clsDA_Menu.IdMenuSub=int_IdMenuSub;
			clsDA_Menu.TenMenu=string_TenMenu;
			clsDA_Menu.SapXep=int_SapXep;
			clsDA_Menu.HienThi_TinTuc=bool_HienThi_TinTuc;
			clsDA_Menu.HienThi_MenuChinh=bool_HienThi_MenuChinh;
			clsDA_Menu.HienThi_MenuBottom=bool_HienThi_MenuBottom;

            boolInsert = clsDA_Menu.Insert(SqlCnn);
			clsDA_Menu = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the Menu table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			Menu_DA clsDA_Menu = new Menu_DA();
			DataTable dt = new DataTable();
            dt = clsDA_Menu.Select(SqlCnn);
			clsDA_Menu= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the Menu table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			Menu_DA clsDA_Menu = new Menu_DA();
			DataTable dt = new DataTable();
			clsDA_Menu.IdMenu=int_IdMenu;

            dt = clsDA_Menu.SelectPrimaryKey(SqlCnn);
			clsDA_Menu= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the Menu table.
		/// <summary>
		/// <param name="IdMenu"></param>
		/// <param name="IdMenuSub"></param>
		/// <param name="TenMenu"></param>
		/// <param name="SapXep"></param>
		/// <param name="HienThi_TinTuc"></param>
		/// <param name="HienThi_MenuChinh"></param>
		/// <param name="HienThi_MenuBottom"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			Menu_DA clsDA_Menu = new Menu_DA();
			clsDA_Menu.IdMenu=int_IdMenu;
			clsDA_Menu.IdMenuSub=int_IdMenuSub;
			clsDA_Menu.TenMenu=string_TenMenu;
			clsDA_Menu.SapXep=int_SapXep;
			clsDA_Menu.HienThi_TinTuc=bool_HienThi_TinTuc;
			clsDA_Menu.HienThi_MenuChinh=bool_HienThi_MenuChinh;
			clsDA_Menu.HienThi_MenuBottom=bool_HienThi_MenuBottom;

            boolUpdate = clsDA_Menu.Update(SqlCnn);
			clsDA_Menu = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the Menu table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			Menu_DA clsDA_Menu = new Menu_DA();
			clsDA_Menu.IdMenu=int_IdMenu;

            boolDelete = clsDA_Menu.Delete(SqlCnn);
			clsDA_Menu = null ;
			return boolDelete;
		}
	}

